from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views

router = DefaultRouter()
router.register(r'connections', views.DatabaseConnectionViewSet)
router.register(r'backups', views.DatabaseBackupViewSet)
router.register(r'query-history', views.QueryHistoryViewSet)
router.register(r'alerts', views.DatabaseAlertViewSet)

urlpatterns = [
    path('', include(router.urls)),
    path('execute-query/', views.execute_sql_query, name='execute_sql_query'),
    path('stats/', views.database_stats, name='database_stats'),
    path('monitoring/collect/', views.collect_monitoring_metrics, name='collect_monitoring_metrics'),
    path('monitoring/history/', views.get_monitoring_history, name='get_monitoring_history'),
    path('monitoring/summary/', views.get_performance_summary, name='get_performance_summary'),

    # Inception SQL审核相关API
    path('audit-sql/', views.audit_sql, name='audit_sql'),
    path('execute-sql/', views.execute_sql, name='execute_sql'),
    path('audit-records/', views.audit_records, name='audit_records'),
]
